Hands-On Robotics with JavaScript by Kassandra Perch
Author:Kassandra Perch
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2018-08-31T05:40:21+00:00
Putting a piece of paper on the motor shaft
Either roll the sticky end of a long sticky note around the motor shaft, or tape a long strip of paper to it. It should look something like this:
After the relatively simple construction of our toy, let's code some randomness!
Coding the randomness to start/stop the motor
We want the motor to start at a random speed for anywhere from 1-10 seconds, then stop for 1-10 seconds, and repeat. We also want whether it goes forward or backward to be random. I limited the speed to 75—anything faster was too much for my cats!
In your cat-toy.js file, get rid of the board.repl.inject statement and add the following:
startMovement()
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Linux Device Driver Development Cookbook by Rodolfo Giometti(3951)
Embedded Programming with Modern C++ Cookbook by Igor Viarheichyk(3713)
Implementing Cellular IoT Solutions for Digital Transformation by Dennis McCain(3640)
Embedded Linux Development Using Yocto Project - Third Edition by Otavio Salvador & Daiane Angolini(3479)
TinyML Cookbook by Gian Marco Iodice(3400)
Simplifying 3D Printing with OpenSCAD by Colin Dow(2850)
TinyML Cookbook by Gian Marco Iodice & Ronan Naughton(2616)
Fusion 360 for Makers by Lydia Sloan Cline(2227)
Networking A Beginner's Guide by Bruce Hallberg(2221)
Hands-On Linux for Architects by Denis Salamanca(2062)
But How Do It Know? by J. Clark Scott(2039)
Computers For Seniors For Dummies by Nancy C. Muir(2020)
Raspberry Pi and MQTT Essentials by Dhairya Parikh(1972)
Arduino Project Handbook, Volume 2: 25 Simple Electronics Projects for Beginners by Geddes Mark(1958)
9781803246888-ENHANCING DEEP LEARNING WITH BAYESIAN INFERENCE by Unknown(1914)
Hack and HHVM by Owen Yamauchi(1893)
31 Days Before Your CompTIA A+ Exams (Shanette Luellen's Library) by Benjamin Patrick Conry(1872)
MicroPython Projects by Jacob Beningo(1754)
Hands-On Internet of Things with MQTT by Tim Pulver(1723)
